#ifndef _GOALSCORE_H_
#define _GOALSCORE_H_

#define THRESHOLD_15_TO_17	170
#define THRESHOLD_17_TO_18	340
#define THRESHOLD_18_TO_19	510
#define THRESHOLD_19_TO_21	680
#define THRESHOLD_21_TO_22	850

/**
 * readScore interpretes the raw value read from the frob knob into the actual score.
 * The thresholds between scores are predefined.
 * 
 * @requires none
 * @effect an actual score that corresponds to the raw value is returned
 * @modifies none
 */

uint16_t readScore(uint16_t frob_val);

/**
 * getGoalScore allows user to adjust for the goal score of the game with frob knob.
 * While adjusting the frob knob, the currently chosen value will be printed in screen.
 * After a value is chosen, press "GO" to continue.
 *
 * @requires none
 * @effect set # of balls to go in each goal 
 * @modifies pointToDo
 */
 
void getGoalScore();

void scoreRight(uint8_t numBalls);
void scoreLeft(uint8_t numBalls);
void score(uint8_t whichside, uint8_t numBalls); // 1: left, 0: right

void calibrateGoalServo();
 
uint8_t isGoalOnTheLeft(void);
uint8_t isGoalOnTheRight(void);
uint8_t isGoal(uint8_t whichside); // 1: left, 0: right

#endif



